import request from '@/utils/request'

// 查询待审批活动列表
export function listActivity(query) {
  return request({
    url: '/gxs/activity/activityList',
    method: 'get',
    params: query
  })
}

// 查询待审批活动详细
export function getActivity(gxsPendActivityid) {
  return request({
    url: '/gxs/activity/' + gxsPendActivityid,
    method: 'get'
  })
}

// 新增待审批活动
export function addActivity(data) {
  return request({
    url: '/gxs/activity',
    method: 'post',
    data: data
  })
}

// 修改活动
export function updateActivity(data) {
  return request({
    url: '/gxs/activity',
    method: 'put',
    data: data
  })
}

// 删除待审批活动
export function delActivity(gxsPendActivityid) {
  return request({
    url: '/gxs/activity/' + gxsPendActivityid,
    method: 'delete'
  })
}

// 查询我的活动列表
export function MyList(query) {
  return request({
    url: '/gxs/activity/MyList',
    method: 'get',
    params: query
  })
}


// 查询已经审批活动列表
export function approvedList(query) {
  return request({
    url: '/gxs/activity/approvedList',
    method: 'get',
    params: query
  })
}

// 查询已经审批活动列表
export function pendApprovedList(query) {
  return request({
    url: '/gxs/activity/pendApprovedList',
    method: 'get',
    params: query
  })
}

// 提交活动
export function submitActivity(gxsPendActivityid) {
  return request({
    url: '/gxs/activity/submit/'+ gxsPendActivityid,
    method: 'put'
  })
}

// 举办活动
export function conductActivity(data) {
  return request({
    url: '/gxs/activity/conduct',
    method: 'put',
    data: data
  })
}


// 审批活动
export function approveActivity(data) {
  return request({
    url: '/gxs/activity/approve',
    method: 'put',
    data: data
  })
}


// 查询待审批活动列表
export function chartList(query) {
  return request({
    url: '/gxs/activity/chartList',
    method: 'get',
    params: query
  })
}
